#include <iostream>
using namespace std;

#define MAX_CAP 10000000
#define DIVISOR 1000000007
int b_block[MAX_CAP + 5];
int c_block[MAX_CAP + 5];

int main() {
    b_block[1] = 1;
    c_block[1] = 2;
    int times = 0;
    cin >> times;
    for(int i = 2; i <= times; i++)
    {
        b_block[i] = 2 * c_block[i - 1] % DIVISOR + 1;
        b_block[i] %= DIVISOR;
        c_block[i] = 2 * c_block[i - 1] % DIVISOR+ 2 + b_block[i - 1] % DIVISOR;
        c_block[i] %= DIVISOR;
    }
    cout << b_block[times] << " " << c_block[times];
    return 0;
}